/* 设备管理的接口 */
import {
  getAction,
  postAction,
  putAction,
  deleteAction,
  httpAction,
} from "../utils/request.js";

// 列表
const devicePage = (params) => getAction("/mini/device/page", params);

// 添加设备组
const deviceInsert = (params) => postAction("/mini/device/insert", params);

// 添加设备组 -- 监控仪厂家
const factoryList = (params) => getAction("/mini/factory/list", params);

// 检测监控仪MN号是否正确
const devicemnFindmnuse = (params) =>
  getAction("/mini/factory/device_mn/find_mn_use", params);

// 编辑净化器信息
const devicePurifySave = (params) =>
  postAction("/mini/device/purify/save", params);

// 编辑添加风机信息
const devicefanSave = (params) => postAction("/mini/device/fan/save", params);

// 编辑烟道
const devicesmokeSave = (params) =>
  postAction("/mini/device/smoke/save", params);

// 编辑监测仪信息
const deviceEdit = (params) => postAction("/mini/device/edit", params);

// 详情 -- 净化器信息
const devicePurifyDetail = (params) =>
  getAction("/mini/device/purify/detail", params);

// 详情 -- 排风机信息
const deviceFanDetail = (params) =>
  getAction("/mini/device/fan/detail", params);

// 详情 -- 烟道信息
const deviceSmokeDetdail = (params) =>
  getAction("/mini/device/smoke/detail", params);

// 详情页中 -- 实时数据近10分钟平均数据
const findDeviceData = (params) =>
  getAction("/mini/device/data/find_device_data", params);

// 详情页中 -- 实时数据 折线图
const findHeartbeatData = (params) =>
  getAction("/mini/device/data/find_heartbeat_data", params);

// 设备详情 -- 历史数据 -- 预警/告警/离线
const eventRecordFindDeviceData = (params) =>
  getAction("/mini/device/event_record/find_device_data", params);

// 设备详情 -- 历史数据 -- 预警/告警/离线列表
const eventRecordDevicePage = (params) =>
  getAction("/mini/device/event_record/device_page", params);

export {
  devicePage,
  deviceInsert,
  factoryList,
  devicemnFindmnuse,
  devicePurifySave,
  devicefanSave,
  devicesmokeSave,
  deviceEdit,
  devicePurifyDetail,
  deviceFanDetail,
  deviceSmokeDetdail,
  findDeviceData,
  findHeartbeatData,
  eventRecordFindDeviceData,
  eventRecordDevicePage,
};
